# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dotdotpwn
pkgver=3.0.2
pkgrel=6
groups=('blackarch' 'blackarch-exploitation' 'blackarch-fuzzer')
pkgdesc='The Transversal Directory Fuzzer.'
url="http://dotdotpwn.blogspot.com"
arch=('any')
license=('GPL2')
depends=('perl' 'perl-http-lite' 'perl-tftp' 'perl-switch' 'perl-io-socket'
         'perl-io-socket-ssl' 'perl-libwww')
install=dotdotpwn.install
source=("https://github.com/wireghoul/$pkgname/archive/$pkgver.tar.gz")
sha512sums=('2621e6fd45b2ace56d83d634ee702fce4ec0dec5fd8819bd33ecfa2b5fa286249744377931a512c574f907426fdfdf4a1069f46b07a83b73a1bc00f1045cc973')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" <<EOF
#!/bin/sh
cd /usr/share/$pkgname
exec perl $pkgname.pl "\$@"
EOF
  chmod +x "$pkgdir/usr/bin/$pkgname"
}

